<!-- This page asks students for their address. If a student's country
     of residence is the U.S., then the address form will ask for State,
     Zip Code, as well as Area Code. Otherwise, the address form will
     only ask for City and Country Telephone Code.
     
     Then, upon clicking submit, if the student is a U.S. citizen, lead 
     him/her to the Provide Degrees - Choose Location Page; otherwise,
     lead him/her to the Residency Page. -->

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="support.*, java.util.*, java.sql.*, javax.sql.*" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> 
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Address Page</title>
</head>
<body>

<CENTER>
<h1> Graduate School Application </h1>
<h2> Address Page </h2>
</CENTER>

<!-- Display data collected from previous pages. -->

<b>First Name:</b> <bean:write name="studentsinfoform" property="first" />
<span style="padding-left:20px"><b>Middle Initial:</b> <bean:write name="studentsinfoform" property="middle" /></span>
<span style="padding-left:20px"><b>Last Name:</b>  <bean:write name="studentsinfoform" property="last" /> </span>
<p>
<b>Country of Citizenship:</b> <bean:write name="citizenshipform" property="citizen" /> <p>
<b>Country of Residence:</b> <bean:write name="residenceform" property="residence"/> <p>

<br><b>Please provide your address.</b> <p>

<div style="color:red">
    <html:errors />
</div>
<html:form action="/address">
<logic:equal name="citizenshipform" property="citizen" value="United States">
Street Address: <html:text name = "addressform" property="street" size="40" /><p>
City: <html:text name = "addressform" property="city" size="10" />
State: <html:text name = "addressform" property="lstate" size="10" />
Zip Code: <html:text name = "addressform" property="zip" size="5" /> <p>
Area Code: <html:text name = "addressform" property="areaCode" size="4" />
Phone Number: <html:text name = "addressform" property="pnumber" size="10" /> <p>
<input type="submit" value="Proceed to Provide Degrees -- Choose Location Page">
</logic:equal>

<logic:notEqual name="citizenshipform" property="citizen" value="United States">
Street Address: <html:text name = "addressform" property="street" size="40" />
City: <html:text name = "addressform" property="city" size="10" /> <p>
Country Telephone Code: <html:text name = "addressform" property="areaCode" size="4" />
Phone Number: <html:text name = "addressform" property="pnumber" size="10" /> <p>
<input type="submit" value="Proceed to Residency Page" >
</logic:notEqual>
</html:form>

</body>
</html>